#pragma once

#ifndef ENTITY_H
#define ENTITY_H

#include <string>
#include <d3d9.h>
#pragma comment(lib, "d3d9.lib")
#pragma comment(lib, "d3dx9.lib")
#include <d3dx9.h>
#include "Collision.h"
#include "Message.h"

class Entity
{
protected:
	D3DXVECTOR3 position;
	IDirect3DTexture9* texture;
	bool alive;
	int ID;
	std::string name;
public:
	D3DXVECTOR3 getPosition() const { return position; }
	void setPosition(D3DXVECTOR3 newPosition) { position = newPosition; }
	IDirect3DTexture9* getTexture() const { return texture; }
	void setTexture(IDirect3DTexture9* newTexture) { texture = newTexture; }
	bool isAlive() const { return alive; }
	void setAlive(bool newAlive) { alive = newAlive; }
	int getID() const { return ID; }
	void setID(int newID) { ID = newID; }
	std::string getName() const { return name; }
	virtual void update(float frameTime) = 0;
	virtual void draw(ID3DXSprite* sprite) = 0;
	virtual void handleMessage(Message message) { }
	Entity();
	Entity(std::string name);
	Entity(int id);
	Entity(int id, std::string name);
	Entity(D3DXVECTOR3 position, IDirect3DTexture9* texture);
	Entity(D3DXVECTOR3 position, IDirect3DTexture9* texture, std::string name);
	Entity(int id, D3DXVECTOR3 position, IDirect3DTexture9* texture);
	Entity(int id, D3DXVECTOR3 position, IDirect3DTexture9* texture, std::string name);
	virtual ~Entity() { }
};

#endif